package com.zhoutian.controller;

import com.zhoutian.service.DetailMessageService;
import com.zhoutian.vo.DetailMessageVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/detailMessage")
@RestController
@Slf4j
@CrossOrigin
public class DetailMessageController {

    @Autowired
    private DetailMessageService detailMessageService;

    @GetMapping("/info")
    public DetailMessageVO info (Integer id) {
        log.info("id: [{}]", id);
        DetailMessageVO detailMessageVO = detailMessageService.selectById(id);
        return detailMessageVO;
    }
}
